package org.amphiprion.descentv2assistant.entity.comparator;

import java.util.Comparator;

import org.amphiprion.descentv2assistant.entity.Monster;

public class MonsterActComparator implements Comparator<Monster> {

	@Override
	public int compare(Monster lhs, Monster rhs) {
		if (lhs.getAct() == rhs.getAct()) {
			if (lhs.isMajor() == rhs.isMajor()) {
				return lhs.getName().compareTo(rhs.getName());
			} else {
				if (lhs.isMajor()) {
					return 1;
				} else {
					return -1;
				}

			}
		} else {
			return lhs.getAct() - rhs.getAct();
		}
	}

}
